
export function newObj (fn, ...args) {
    if (!fn || !fn.prototype) {
        throw new Error("Error")
    }
    let obj = Object.create(fn.prototype)
    let res = fn.call(obj, ...args)
    if ((typeof res === "object" && res != null) || typeof res === "function") {
        return res
    }
    return obj
}